<?php
require_once 'init_app.php';

set_time_limit(0); 

$products = ORM::factory('product')
                ->join('product_data', 'LEFT')
                ->on('product_data.product_id', '=', 'product.id')
                ->where('is_processed', '=', 0)
                ->where('product_data.params', 'IS NOT', NULL)
                ->limit(100000)
                ->find_all();
$n = 0;
foreach ($products as $product) {
    $product->process_params();
    $n++; 
}

echo $n."\n";
echo 'ok';







